$(function () {
    var repertoryid = $("#repertoryid").val();
    var token = $("#token").val();
    if (isempty(token)) {
        location.href = '/except/login.jsp';
        return;
    } else {
        var jsonstr = "{token:" + token + "}";
        var url = "/except/indentcontroller/repertoryinfo.action";
        $.ajax({
            url: url,
            type: 'post',
            dataType: "json",
            data: {
                json: jsonstr,
                repertoryid:repertoryid
            },
            async: false,
            success: function (data) {
                var code = data.code;
                var message = data.message;
                if (code == 10001 || code == 10002)
                    location.href = "/except/login.jsp";
                else if (code == 20000) {
                    $("#shopimg").attr("src", data.data.img);
                    $("#shopname").html(data.data.shop_name);
                    $("#shop_weight").html(data.data.shop_weight);
                    $("#shop_price").html(data.data.price);
                    $("#expired").html(data.data.expired);
                    $("#specname").html(data.data.name);
                    $("#surplusnum").html(data.data.surplusnum);
                } else {
                    $("#hint_message").html(message);
                    $("#hintbg").show();
                }
                remove_advertising();
            }
        });
    }
});